<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="./template.xhtml">

    <ui:define name="title">
        DataTable - <span class="subitem">Paginator</span>
    </ui:define>

    <ui:define name="description">
        DataTable provides a highly customizable ajax paginator.
    </ui:define>

    <ui:param name="documentationLink" value="/components/datatable" />

    <ui:define name="implementation">
        
        <h:form>
            <p:dataTable var="car" value="#{dtPaginatorView.cars}" rows="10" 
                         paginator="true"
                         paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records" 
                         rowsPerPageTemplate="5,10,15">
                <p:column headerText="Id">
                    <h:outputText value="#{car.id}" />
                </p:column>

                <p:column headerText="Year">
                    <h:outputText value="#{car.year}" />
                </p:column>

                <p:column headerText="Brand">
                    <h:outputText value="#{car.brand}" />
                </p:column>

                <p:column headerText="Color">
                    <h:outputText value="#{car.color}" />
                </p:column>

                <f:facet name="paginatorTopLeft">
                    <p:commandButton type="button" icon="pi pi-refresh" />
                </f:facet>

                <f:facet name="paginatorBottomRight">
                    <p:commandButton type="button" icon="pi pi-cloud-upload" />
                </f:facet>

            </p:dataTable>
        </h:form>
        
    </ui:define>

</ui:composition>